﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UWP.Douban.Api;

namespace UWP.Douban.Models
{
    public class Authenticate
    {
        [JsonProperty("access_token")]
        public string AccessToken { get; set; }

        [JsonProperty("douban_user_name")]
        public string UserName { get; set; }

        [JsonProperty("douban_user_id")]
        public string UserId { get; set; }

        [JsonProperty("expires_in")]
        public string ExpiresIn { get; set; }

        [JsonProperty("refresh_token")]
        public string RefreshToken { get; set; }

        [JsonProperty("token_time")]
        public DateTime GetTokenTime { get; set; }

        public void SetCommon()
        {
            Common.Token = AccessToken;
            Common.UserId = UserId;
            Common.RefreshToken = RefreshToken;
            Common.ExpiresIn = ExpiresIn;
            Common.UserName = UserName;
            Common.TokenTime = GetTokenTime;
        }
    }

}
